﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.Threading.Tasks;

namespace LevelEditor.App.Serialization
{
    [XmlRoot("layer")]
    public class SLayer
    {
        private string name;
        [XmlElement("Name")]
        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        private int rows;
        [XmlElement("rows")]
        public int Rows
        {
            get { return rows; }
            set { rows = value; }
        }

        private int cols;
        [XmlElement("cols")]
        public int Cols
        {
            get { return cols; }
            set { cols = value; }
        }

        private int tileWidth;
        [XmlElement("TileWidth")]
        public int TileWidth
        {
            get { return tileWidth; }
            set { tileWidth = value; }
        }

        private int tileHeight;
        [XmlElement("TileHeight")]
        public int TileHeight
        {
            get { return tileHeight; }
            set { tileHeight = value; }
        }

        [XmlArray("Tiles")]
        [XmlArrayItem("Tile")]
        public List<STile> stiles {get;set;}

        public SLayer()
        {
            stiles = new List<STile>();
        }
    }
}
